473,416 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

AS 3.0 - making a movie clip into a clickable button

3
I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects:

import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut});
TransitionManager.start(img4_mc, {type:Rotate, direction:Transition.IN, duration:30, easing:Strong.easeInOut, ccw:false, degrees:720});
TransitionManager.start(img4_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});
TransitionManager.start(img4_mc, {type:Fade, direction:Transition.IN, duration:4, easing:Strong.easeOut});
TransitionManager.start(img4_mc, {type:Photo, direction:Transition.IN, duration:4, easing:None.easeNone});

This works great but, when that _mc comes to rest - I want it to be clickable.
I went and tried to put code that would make this clickable and put it in the same frame - but, then my _mc wouldn't spin. Then I put the code on the first frame of the actual _mc and it did the same thing.

Why does the code to make it clickable cancel out the code that makes it spin?
What's the best way to do this? ( I want it to spin and then be able to click on it)

Big Thanks,
zb
Feb 6 '08 #1
3 5770
nomad
664 Expert 512MB
I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects:

import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut});
TransitionManager.start(img4_mc, {type:Rotate, direction:Transition.IN, duration:30, easing:Strong.easeInOut, ccw:false, degrees:720});
TransitionManager.start(img4_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});
TransitionManager.start(img4_mc, {type:Fade, direction:Transition.IN, duration:4, easing:Strong.easeOut});
TransitionManager.start(img4_mc, {type:Photo, direction:Transition.IN, duration:4, easing:None.easeNone});

This works great but, when that _mc comes to rest - I want it to be clickable.
I went and tried to put code that would make this clickable and put it in the same frame - but, then my _mc wouldn't spin. Then I put the code on the first frame of the actual _mc and it did the same thing.

Why does the code to make it clickable cancel out the code that makes it spin?
What's the best way to do this? ( I want it to spin and then be able to click on it)

Big Thanks,
zb
What does your button Timeline look like.
and what are your actions for the button look like.

nomad
Feb 6 '08 #2
zb42
3
Thanks for the reply -
The current state of the code is here. I have it listed in the first frame of the layer on which the movie clip 'img4_mc' resides.

zb
++++++



import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut});
TransitionManager.start(img4_mc, {type:Rotate, direction:Transition.IN, duration:30, easing:Strong.easeInOut, ccw:false, degrees:720});
TransitionManager.start(img4_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});
TransitionManager.start(img4_mc, {type:Fade, direction:Transition.IN, duration:4, easing:Strong.easeOut});
TransitionManager.start(img4_mc, {type:Photo, direction:Transition.IN, duration:5, easing:None.easeNone});

function centerClick(event:MouseEvent):void
{
var request:URLRequest = new URLRequest("index.cgi");
navigateToURL(request, "_self");
}
img4_mc.buttonMode = true;
img4_mc.addEventListener(MouseEvent.CLICK, centerClick);
Feb 7 '08 #3
zb42
3
Well, I solved my problem.
In the post above, the linkage script is pretty much correct
for making a mc clickable to a url in AS3.

But, it is extremly important to remember the little
'import flash.net' thingy at the top of your script.

zb42
Feb 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: torbs | last post by:
I have a problem when I use javascript to get the length and position of a movie I recieve from a rtsp stream. The length and position is extremely high and not the actual length and position of...
6
by: P3dro0203 | last post by:
I have got a Movie clip that i have made in FLASH MX, and when i attach a actionscript to the button the hit CTRL + ENTER so veiw the SWF file, the actionscripting does not work. Is this becasue i...
10
elamberdor
by: elamberdor | last post by:
Hello All! Well, I can load in swf's just loverly, but what I have is a sliding menu, with buttons in it, that when pressed, load an image into an empty movieclip. I really just need to know how...
0
by: RLW | last post by:
Hi, I inherited a Flash usability problem: It's a self assessment test created in Flash. I think it was originally built using individual flash files for each question and arrays. Now it has...
2
by: robtyketto | last post by:
Greetings, I have workable code to allow movie clips to be dragged around. However I can't find an example of a drag n drop where the movie clip has to be placed with a certain range/xy...
5
by: mukeshrasm | last post by:
Hi I want to play/pause a movie clip when I click a button and the value of button should changed to play when it is paused and pause when it is playing. I am new to flash so how can I do it.
5
by: Katt | last post by:
first of all I am new to flash. I just started to use CS3, and I have 2.0 actionscript selected Cannot get my MC button instance to go play a movie clip on another frame, I have tried...
2
by: Mickey Flores | last post by:
I have just tried to attach a background sound with on/off button to my movie clip at frame 1 of the main Timeline. Flash Movie: the movie will keep on replaying until a viewer clicks a button....
1
by: angelicdevil | last post by:
ok wat i m trying to do it get flash to read a xml file and load the titles in xml as a button into the imagetitles movie clip made on stage in flash . so that when i click on a title it displays...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.